#pragma once

#include "stdafx.h"
#include "Algorithm.h"

void Algorithm::relocate(Node* node){
	// TODO.
	return;
}

void Algorithm::locateChild(Node* child){
	Node* parents = child->getParents();
	Pos* parentsPos = parents->getPos();
	CRect* parentsBound = parents->getTextBound();
	
	Pos childPos;
	childPos.x = parentsPos->x + this->getWidth(parentsBound) + SIZE_EDGE_WIDTH ;
	childPos.y = parentsPos->y;
	child->setPos(&childPos);
	return;
}

int Algorithm::getWidth(CRect* bound){
	return bound->right - bound->left;
}

int Algorithm::getHeight(CRect* bound){
	return bound->bottom - bound->top;
}
